#!/bin/sh /etc/rc.common
START=91
USE_PROCD=1

BIN=/usr/sbin/bmx7
CONF=/etc/config/bmx7

start_service() {
	cd /root/ || return
	while pgrep -f mac80211.sh ; do sleep 1; done

	procd_open_instance "bmx7"
	procd_set_param command "$BIN"
	procd_append_param command -f "$CONF" -d0
	procd_set_param limits core=20000
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_set_param respawn
	procd_close_instance
}

reload_service() {
    "$BIN" -c configReload
}

service_triggers() {
    procd_add_reload_trigger "bmx7"
}
